<?xml version="1.0" encoding="utf-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.example.com/Orders"
  xmlns="http://www.example.com/Orders"
  elementFormDefault="qualified">

  <!--Description of Batch-->
  <xs:element name="Batch">
    <xs:complexType>
      <xs:sequence>
        <!--List of all Purchase Orders-->
        <xs:element ref="PurchaseOrder"
                    minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
  <!--Purchase Order-->
  <xs:element name="PurchaseOrder">
    <xs:complexType>
      <xs:sequence>
        <!--Customer Number-->
        <xs:element name="CustId" type="xs:string"/>
        <!--List of all Order Items-->
        <xs:element ref="Item"
                    minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <!--Order Item-->
  <xs:element name="Item">
    <xs:complexType>
      <xs:sequence>
        <!--Product Number-->
        <xs:element name="ProdId" type="xs:string"/>
        <!--Price-->
        <xs:element name="Price" type="xs:double"/>
        <!--Quantity-->
        <xs:element name="Quantity" type="xs:int"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
</xs:schema>